import constant from '../../constant';
import menus from '../data/menus.json';

// 0 目录，1 菜单， 2 权限

export default [
    {
        url: constant.API.COMMON.UPLOAD,
        type: 'post',
        response: {"code":1000,"message":"success","data":"https://cool-admin-test.oss-cn-shenzhen.aliyuncs.com/20200625/32b67070-b6e3-11ea-9303-11217048e856.png"}
    },
    {
        url: constant.API.COMMON.USER_LOGIN,
        type: 'post',
        response: {
            'code': 1000,
            'message': 'success',
            'data': {
                'expire': 604800,
                'token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlSWRzIjpbIjEiXSwidXNlcklkIjoiMSIsInBhc3N3b3JkVmVyc2lvbiI6MSwiaWF0IjoxNTkyNzIyNzMwLCJleHAiOjE1OTMzMjc1MzB9.lEjNK1JQb7Q9KJ2PePS6YPNERWf0uXXtW6fgjLsSZ7Y'
            }
        }
    },
    {
        url: constant.API.COMMON.USER_INFO,
        type: 'post',
        response: {
            'code': 1000,
            'message': 'success',
            'data': {
                'id': '1',
                'createTime': '2019-06-25 10:20:20',
                'updateTime': '2019-11-12 09:40:27',
                'departmentId': '1',
                'name': '超级管理员',
                'username': 'admin',
                'passwordV': 1,
                'nickName': '豪猪',
                'headImg': 'head.png',
                'phone': '18000000000',
                'email': '123456@qq.com',
                'remark': '备注',
                'status': 1,
                'roleIdList': ['1'],
                'departmentName': 'SYS-ADMIN'
            }
        }
    },
    // 获取所有菜单与权限，并根据权限筛选出菜单
    {
        url: constant.API.COMMON.PERM_MENU,
        type: 'post',
        response: (config => {
            // return {
            //     'code': 1000,
            //     'message': 'success',
            //     'data': {
            //         'perms': ['dashboard', 'sys:log:page', 'sys:log:clear', 'sys:log:get-keep', 'sys:log:set-keep'],
            //         'menus':  menus
            //     }
            // }
            return {
                'code': 1000, 'message': 'success', 'data': {
                    'perms': ['sys:menu:add', 'sys:menu:delete', 'sys:menu:update', 'sys:menu:page', 'sys:menu:list', 'sys:menu:info', 'sys:user:add', 'sys:user:delete', 'sys:user:update', 'sys:user:page', 'sys:user:list', 'sys:user:info', 'sys:role:add', 'sys:role:delete', 'sys:role:update', 'sys:role:page', 'sys:role:list', 'sys:role:info', 'sys:log:page', 'sys:log:clear', 'sys:log:get-keep', 'sys:log:set-keep', 'sys:department:list', 'sys:department:add', 'sys:department:update', 'sys:department:delete', 'sys:department:order', 'sys:user:move', 'sys:info:record', 'sys:task:add', 'sys:task:delete', 'sys:task:info', 'sys:task:update', 'sys:task:page', 'sys:task:log', 'sys:task:once', 'sys:task:start', 'sys:task:stop', 'sys:param:add', 'sys:param:info', 'sys:param:update', 'sys:param:delete', 'sys:param:page', 'sys:param:list'],
                    'menus': [{
                        'id': '48',
                        'createTime': '2019-11-08 09:35:53',
                        'updateTime': '2019-11-08 09:37:02',
                        'parentId': '47',
                        'name': '文档',
                        'router': '/tutorial/doc',
                        'perms': null,
                        'type': 1,
                        'icon': 'icon-favorfill',
                        'orderNum': 0,
                        'viewPath': 'https://docs.cool-admin.com/#/',
                        'keepAlive': 1
                    }, {
                        'id': '59',
                        'createTime': '2019-11-18 16:50:27',
                        'updateTime': '2019-11-18 16:50:27',
                        'parentId': '17',
                        'name': '部门列表',
                        'router': null,
                        'perms': 'sys:department:list',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '60',
                        'createTime': '2019-11-18 16:50:45',
                        'updateTime': '2019-11-18 16:50:45',
                        'parentId': '17',
                        'name': '新增部门',
                        'router': null,
                        'perms': 'sys:department:add',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '61',
                        'createTime': '2019-11-18 16:50:59',
                        'updateTime': '2019-11-18 16:50:59',
                        'parentId': '17',
                        'name': '更新部门',
                        'router': null,
                        'perms': 'sys:department:update',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '62',
                        'createTime': '2019-11-18 16:51:13',
                        'updateTime': '2019-11-18 16:51:13',
                        'parentId': '17',
                        'name': '删除部门',
                        'router': null,
                        'perms': 'sys:department:delete',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '63',
                        'createTime': '2019-11-18 17:49:35',
                        'updateTime': '2019-11-18 17:49:35',
                        'parentId': '17',
                        'name': '部门排序',
                        'router': null,
                        'perms': 'sys:department:order',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '65',
                        'createTime': '2019-11-18 23:59:21',
                        'updateTime': '2019-11-18 23:59:21',
                        'parentId': '17',
                        'name': '用户转移',
                        'router': null,
                        'perms': 'sys:user:move',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '67',
                        'createTime': '2019-11-26 23:50:13',
                        'updateTime': '2019-11-26 23:50:13',
                        'parentId': '66',
                        'name': '记录',
                        'router': null,
                        'perms': 'sys:info:record',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '71',
                        'createTime': '2019-12-10 13:25:33',
                        'updateTime': '2019-12-10 13:25:33',
                        'parentId': '70',
                        'name': '新增',
                        'router': null,
                        'perms': 'sys:task:add',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '72',
                        'createTime': '2019-12-10 13:25:45',
                        'updateTime': '2019-12-10 13:25:45',
                        'parentId': '70',
                        'name': '删除',
                        'router': null,
                        'perms': 'sys:task:delete',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '73',
                        'createTime': '2019-12-10 13:26:03',
                        'updateTime': '2019-12-10 13:26:18',
                        'parentId': '70',
                        'name': '修改',
                        'router': null,
                        'perms': 'sys:task:info,sys:task:update',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '74',
                        'createTime': '2019-12-10 13:26:49',
                        'updateTime': '2019-12-10 13:26:49',
                        'parentId': '70',
                        'name': '查看',
                        'router': null,
                        'perms': 'sys:task:page,sys:task:info,sys:task:log',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '75',
                        'createTime': '2019-12-10 13:27:10',
                        'updateTime': '2019-12-10 13:27:10',
                        'parentId': '70',
                        'name': '立即执行',
                        'router': null,
                        'perms': 'sys:task:once',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '76',
                        'createTime': '2019-12-10 13:27:24',
                        'updateTime': '2019-12-10 13:27:24',
                        'parentId': '70',
                        'name': '开始',
                        'router': null,
                        'perms': 'sys:task:start',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '77',
                        'createTime': '2019-12-10 13:27:36',
                        'updateTime': '2019-12-10 13:27:36',
                        'parentId': '70',
                        'name': '暂停',
                        'router': null,
                        'perms': 'sys:task:stop',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '79',
                        'createTime': '2019-12-10 13:29:33',
                        'updateTime': '2019-12-10 13:29:33',
                        'parentId': '78',
                        'name': '参数列表',
                        'router': '/sys/param',
                        'perms': null,
                        'type': 1,
                        'icon': 'icon-menu',
                        'orderNum': 0,
                        'viewPath': 'views/test.vue',
                        'keepAlive': 1
                    }, {
                        'id': '80',
                        'createTime': '2019-12-10 13:29:50',
                        'updateTime': '2019-12-10 13:29:50',
                        'parentId': '79',
                        'name': '新增',
                        'router': null,
                        'perms': 'sys:param:add',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '81',
                        'createTime': '2019-12-10 13:30:10',
                        'updateTime': '2019-12-10 13:30:10',
                        'parentId': '79',
                        'name': '修改',
                        'router': null,
                        'perms': 'sys:param:info,sys:param:update',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '82',
                        'createTime': '2019-12-10 13:30:25',
                        'updateTime': '2019-12-10 13:30:25',
                        'parentId': '79',
                        'name': '删除',
                        'router': null,
                        'perms': 'sys:param:delete',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '83',
                        'createTime': '2019-12-10 13:30:40',
                        'updateTime': '2019-12-10 13:30:40',
                        'parentId': '79',
                        'name': '查看',
                        'router': null,
                        'perms': 'sys:param:page,sys:param:list,sys:param:info',
                        'type': 2,
                        'icon': null,
                        'orderNum': 0,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '1',
                        'createTime': '2019-09-11 11:14:44',
                        'updateTime': '2019-11-18 15:56:36',
                        'parentId': null,
                        'name': '工作台',
                        'router': '/',
                        'perms': null,
                        'type': 0,
                        'icon': 'icon-gongzuotai',
                        'orderNum': 1,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '10',
                        'createTime': '2019-09-12 00:19:27',
                        'updateTime': '2019-09-12 00:19:27',
                        'parentId': '8',
                        'name': '新增',
                        'router': null,
                        'perms': 'sys:menu:add',
                        'type': 2,
                        'icon': null,
                        'orderNum': 1,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '17',
                        'createTime': '2019-09-12 00:31:25',
                        'updateTime': '2019-09-15 23:45:57',
                        'parentId': '27',
                        'name': '用户列表',
                        'router': '/sys/user',
                        'perms': null,
                        'type': 1,
                        'icon': 'icon-user',
                        'orderNum': 1,
                        'viewPath': 'views/system/user/index.vue',
                        'keepAlive': 1
                    }, {
                        'id': '18',
                        'createTime': '2019-09-12 00:32:21',
                        'updateTime': '2019-11-09 22:22:19',
                        'parentId': '17',
                        'name': '新增',
                        'router': null,
                        'perms': 'sys:user:add',
                        'type': 2,
                        'icon': null,
                        'orderNum': 1,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '23',
                        'createTime': '2019-09-12 00:34:23',
                        'updateTime': '2019-09-12 00:34:23',
                        'parentId': '22',
                        'name': '新增',
                        'router': null,
                        'perms': 'sys:role:add',
                        'type': 2,
                        'icon': null,
                        'orderNum': 1,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '27',
                        'createTime': '2019-09-12 15:52:44',
                        'updateTime': '2019-09-15 22:11:56',
                        'parentId': '2',
                        'name': '权限管理',
                        'router': null,
                        'perms': null,
                        'type': 0,
                        'icon': 'icon-permission',
                        'orderNum': 1,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '29',
                        'createTime': '2019-09-12 17:35:51',
                        'updateTime': '2019-11-26 23:46:53',
                        'parentId': '28',
                        'name': '请求日志',
                        'router': '/sys/log',
                        'perms': '',
                        'type': 1,
                        'icon': 'icon-log',
                        'orderNum': 1,
                        'viewPath': 'views/test.vue',
                        'keepAlive': 0
                    }, {
                        'id': '30',
                        'createTime': '2019-09-12 17:37:03',
                        'updateTime': '2019-11-18 14:20:27',
                        'parentId': '29',
                        'name': '权限',
                        'router': null,
                        'perms': 'sys:log:page,sys:log:clear,sys:log:get-keep,sys:log:set-keep',
                        'type': 2,
                        'icon': null,
                        'orderNum': 1,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '43',
                        'createTime': '2019-11-07 14:22:34',
                        'updateTime': '2019-11-09 22:11:18',
                        'parentId': '45',
                        'name': 'crud 示例',
                        'router': '/crud',
                        'perms': null,
                        'type': 1,
                        'icon': 'icon-radioboxfill',
                        'orderNum': 1,
                        'viewPath': 'views/test.vue',
                        'keepAlive': 1
                    }, {
                        'id': '53',
                        'createTime': '2019-11-11 15:21:00',
                        'updateTime': '2019-11-11 15:21:00',
                        'parentId': '1',
                        'name': '组件预览',
                        'router': '/ui-components',
                        'perms': null,
                        'type': 1,
                        'icon': 'icon-activityfill',
                        'orderNum': 1,
                        'viewPath': 'views/test.vue',
                        'keepAlive': 1
                    }, {
                        'id': '70',
                        'createTime': '2019-12-10 13:25:06',
                        'updateTime': '2019-12-10 13:28:53',
                        'parentId': '69',
                        'name': '任务列表',
                        'router': '/sys/task',
                        'perms': null,
                        'type': 1,
                        'icon': 'icon-radioboxfill',
                        'orderNum': 1,
                        'viewPath': 'views/test.vue',
                        'keepAlive': 1
                    }, {
                        'id': '2',
                        'createTime': '2019-09-11 11:14:47',
                        'updateTime': '2019-09-18 15:37:18',
                        'parentId': null,
                        'name': '系统',
                        'router': '/sys',
                        'perms': null,
                        'type': 0,
                        'icon': 'icon-systemfill',
                        'orderNum': 2,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '8',
                        'createTime': '2019-09-11 23:19:57',
                        'updateTime': '2019-09-12 15:53:39',
                        'parentId': '27',
                        'name': '菜单列表',
                        'router': '/sys/menu',
                        'perms': null,
                        'type': 1,
                        'icon': 'icon-menu',
                        'orderNum': 2,
                        'viewPath': 'views/test.vue',
                        'keepAlive': 1
                    }, {
                        'id': '11',
                        'createTime': '2019-09-12 00:19:51',
                        'updateTime': '2019-09-12 00:19:51',
                        'parentId': '8',
                        'name': '删除',
                        'router': null,
                        'perms': 'sys:menu:delete',
                        'type': 2,
                        'icon': null,
                        'orderNum': 2,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '19',
                        'createTime': '2019-09-12 00:32:34',
                        'updateTime': '2019-09-12 00:32:34',
                        'parentId': '17',
                        'name': '删除',
                        'router': null,
                        'perms': 'sys:user:delete',
                        'type': 2,
                        'icon': null,
                        'orderNum': 2,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '24',
                        'createTime': '2019-09-12 00:34:40',
                        'updateTime': '2019-09-12 00:34:40',
                        'parentId': '22',
                        'name': '删除',
                        'router': null,
                        'perms': 'sys:role:delete',
                        'type': 2,
                        'icon': null,
                        'orderNum': 2,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '28',
                        'createTime': '2019-09-12 17:19:16',
                        'updateTime': '2019-09-15 22:12:08',
                        'parentId': '2',
                        'name': '系统监控',
                        'router': null,
                        'perms': null,
                        'type': 0,
                        'icon': 'icon-monitor',
                        'orderNum': 2,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '45',
                        'createTime': '2019-11-07 22:36:57',
                        'updateTime': '2019-11-11 15:21:10',
                        'parentId': '1',
                        'name': '组件库',
                        'router': '/ui-lib',
                        'perms': null,
                        'type': 0,
                        'icon': 'icon-activityfill',
                        'orderNum': 2,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '66',
                        'createTime': '2019-11-26 23:48:16',
                        'updateTime': '2019-11-26 23:48:29',
                        'parentId': '28',
                        'name': '服务状态',
                        'router': '/sys/perf',
                        'perms': null,
                        'type': 1,
                        'icon': 'icon-monitor',
                        'orderNum': 2,
                        'viewPath': 'views/test.vue',
                        'keepAlive': 0
                    }, {
                        'id': '12',
                        'createTime': '2019-09-12 00:20:05',
                        'updateTime': '2019-09-12 00:20:05',
                        'parentId': '8',
                        'name': '修改',
                        'router': null,
                        'perms': 'sys:menu:update',
                        'type': 2,
                        'icon': null,
                        'orderNum': 3,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '20',
                        'createTime': '2019-09-12 00:32:47',
                        'updateTime': '2019-09-12 00:32:47',
                        'parentId': '17',
                        'name': '修改',
                        'router': null,
                        'perms': 'sys:user:update',
                        'type': 2,
                        'icon': null,
                        'orderNum': 3,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '22',
                        'createTime': '2019-09-12 00:34:01',
                        'updateTime': '2019-09-15 23:47:27',
                        'parentId': '27',
                        'name': '角色列表',
                        'router': '/sys/role',
                        'perms': null,
                        'type': 1,
                        'icon': 'icon-role',
                        'orderNum': 3,
                        'viewPath': 'views/test.vue',
                        'keepAlive': 1
                    }, {
                        'id': '25',
                        'createTime': '2019-09-12 00:34:53',
                        'updateTime': '2019-09-12 00:34:53',
                        'parentId': '22',
                        'name': '修改',
                        'router': null,
                        'perms': 'sys:role:update',
                        'type': 2,
                        'icon': null,
                        'orderNum': 3,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '47',
                        'createTime': '2019-11-08 09:35:08',
                        'updateTime': '2019-11-08 19:44:44',
                        'parentId': null,
                        'name': '教程',
                        'router': '/tutorial',
                        'perms': null,
                        'type': 0,
                        'icon': 'icon-weibiaoti4',
                        'orderNum': 3,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '49',
                        'createTime': '2019-11-09 22:11:13',
                        'updateTime': '2019-11-09 22:11:34',
                        'parentId': '45',
                        'name': 'Quill富文本',
                        'router': '/editor-quill',
                        'perms': null,
                        'type': 1,
                        'icon': 'icon-radioboxfill',
                        'orderNum': 3,
                        'viewPath': 'views/test.vue',
                        'keepAlive': 1
                    }, {
                        'id': '69',
                        'createTime': '2019-12-10 13:24:18',
                        'updateTime': '2019-12-10 13:24:18',
                        'parentId': '2',
                        'name': '任务管理',
                        'router': null,
                        'perms': null,
                        'type': 0,
                        'icon': 'icon-weibiaoti4',
                        'orderNum': 3,
                        'viewPath': null,
                        'keepAlive': 1
                    }, {
                        'id': '13',
                        'createTime': '2019-09-12 00:20:19',
                        'updateTime': '2019-09-12 00:20:19',
                        'parentId': '8',
                        'name': '查询',
                        'router': null,
                        'perms': 'sys:menu:page,sys:menu:list,sys:menu:info',
                        'type': 2,
                        'icon': null,
                        'orderNum': 4,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '21',
                        'createTime': '2019-09-12 00:33:00',
                        'updateTime': '2019-09-12 00:33:00',
                        'parentId': '17',
                        'name': '查询',
                        'router': null,
                        'perms': 'sys:user:page,sys:user:list,sys:user:info',
                        'type': 2,
                        'icon': null,
                        'orderNum': 4,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '26',
                        'createTime': '2019-09-12 00:35:05',
                        'updateTime': '2019-09-12 00:35:05',
                        'parentId': '22',
                        'name': '查询',
                        'router': null,
                        'perms': 'sys:role:page,sys:role:list,sys:role:info',
                        'type': 2,
                        'icon': null,
                        'orderNum': 4,
                        'viewPath': null,
                        'keepAlive': 0
                    }, {
                        'id': '78',
                        'createTime': '2019-12-10 13:27:56',
                        'updateTime': '2019-12-10 13:28:37',
                        'parentId': '2',
                        'name': '参数配置',
                        'router': null,
                        'perms': null,
                        'type': 0,
                        'icon': 'icon-repairfill',
                        'orderNum': 4,
                        'viewPath': null,
                        'keepAlive': 1
                    }]
                }
            };
        })
    },
    {
        url: constant.API.COMMON.USER_LOGOUT,
        type: 'post',
        response: {
            'code': 1000,
            'message': 'success'
        }
    }
];
